﻿using FluentNHibernate.Mapping;
using Kratos.Framework.ContentManagement.Models;
using Kratos.Framework.ContentManagement.Models.Order;

namespace Kratos.Framework.ContentManagement.Maps.Order
{
    public class UserInfoMap : ClassMap<UserInfo>
    {
        public UserInfoMap()
        {
            Id(m => m.Id).GeneratedBy.Identity();

            Map(m => m.UserId);

            Map(m => m.Password);

            Map(m => m.LastLogOnTime);

            Map(m => m.CreateTime);

            //当inverse=true时 子拥有外键，子维护父关系,推荐
            //当inverse=false时，父端维护关系
            HasMany<Orders>(m => m.Orders).KeyColumn("UserId").Inverse().Cascade.All();
        }
    }
}
